package Thread;
//模拟三个老师同时分发30份笔试试卷，每个老师相当于一个线程。
public class Teachers implements Runnable {
    public void run() {
        for(int i=1;i<=30;i++){
            System.out.println(Thread.currentThread().getName()+"正在发第"+i+"份试卷");
        }
    }

    public static void main(String[] args) {
        Runnable rb=new Teachers();
        Thread t1=new Thread(rb,"A老师");
        Thread t2=new Thread(rb,"B老师");
        Thread t3=new Thread(rb,"C老师");
        t1.start();
        t2.start();
        t3.start();
    }
}
